package shuati.meituan;

import java.util.Scanner;

/**
 * @author : LdLtd
 * @Date : 2024/4/6
 * @Description:
 * 给出n个数字，问有多少个实数，
 * 可能的形式 -i i 2+i 2+0i -2+0i
 */
public class c040602 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        sc.nextLine();
        int res = 0;
        for (int i = 0; i < n; i++) {
            String next = sc.next();
            if (next.contains("i")) {
                // -i i 2+i 2+0i -2+0i
                String[] split = next.split("[+-]");
                if (split.length == 2&& split[1].startsWith("0") || (split.length == 3 && split[2].startsWith("0"))) {
                    res++;
                }
            } else {
                res++;
            }
        }
        System.out.println(res);
    }
}
